package cn.hyl.design.proxy;


import java.lang.reflect.Proxy;

/**
 * IntermediaryJdkProxyFactory
 *
 * @author hyl
 * @date 2025-06-09
 */
public class IntermediaryJdkProxyFactory {
    public static <T> T create(Object target) {
        //中介
         IntermediaryInvocationHandler handler = new IntermediaryInvocationHandler(target);
         return (T) Proxy.newProxyInstance(target.getClass()
                 .getClassLoader(), target.getClass()
                 .getInterfaces(), handler);
         }
}
